package leetcode_401_500;

import java.util.Arrays;

public class LeeCode_455 {
    public static void main(String[] args) {

    }
    public int findContentChildren(int[] g, int[] s) {
        Arrays.sort(g);
        Arrays.sort(s);
        int l = 0, r = 0, ans = 0;
        while (l < g.length && r < s.length){
            if (s[r] >= g[l]){
                r++;
                l++;
                ans++;
            }else {
                r++;
            }
        }
        return ans;
    }
}
